package ve.ejb.entity;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import ve.ejb.entity.SRM.Status;

/**
 *
 * @author memozac
 */
@Entity
public class SRMTopic implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long idSRMTopic;

    @ManyToOne
    @JoinColumn(name="idTopic",nullable=false,updatable=true)
    private Topic topic;

    @ManyToOne
    @JoinColumn(name="idSRM",nullable=false,updatable=true)
    private SRM SRM;

    @ManyToOne private Person responsible;
    
    @OneToMany private Collection<Agreement> agreements;

    @Temporal(value = TemporalType.TIMESTAMP) private Date SRMDate;

    @Temporal(value = TemporalType.TIMESTAMP) private Date nextMeeting;

    @Column(columnDefinition="text") private String name;

    @Column(columnDefinition="text") private String place;

    @Column(columnDefinition="text") private String description;

    @Column(columnDefinition="text") private Double progress;

    @Enumerated private Status status;

    @Temporal(value = TemporalType.TIMESTAMP) private Date registerDate;
    
    private Double expectedTime;

    public Date getRegisterDate() {
        return registerDate;
    }

    public void setRegisterDate(Date registerDate) {
        this.registerDate = registerDate;
    }
    
    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getSRMDate() {
        return SRMDate;
    }

    public void setSRMDate(Date SRMDate) {
        this.SRMDate = SRMDate;
    }

    public Collection<Agreement> getAgreements() {
        return agreements;
    }

    public void setAgreements(Collection<Agreement> agreements) {
        this.agreements = agreements;
    }

    public String getPlace() {
        return place;
    }

    public void setPlace(String place) {
        this.place = place;
    }

    public Person getResponsible() {
        return responsible;
    }

    public void setResponsible(Person responsible) {
        this.responsible = responsible;
    }

    public Date getNextMeeting() {
        return nextMeeting;
    }

    public void setNextMeeting(Date nextMeeting) {
        this.nextMeeting = nextMeeting;
    }

    public Double getProgress() {
        return progress;
    }

    public void setProgress(Double progress) {
        this.progress = progress;
    }

    public Double getExpectedTime() {
        return expectedTime;
    }

    public void setExpectedTime(Double expectedTime) {
        this.expectedTime = expectedTime;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public SRM getSRM() {
        return SRM;
    }

    public void setSRM(SRM SRM) {
        this.SRM = SRM;
    }

    public Long getIdSRMTopic() {
        return idSRMTopic;
    }

    public void setIdSRMTopic(Long idSRMTopic) {
        this.idSRMTopic = idSRMTopic;
    }

    public Topic getTopic() {
        return topic;
    }

    public void setTopic(Topic topic) {
        this.topic = topic;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSRMTopic != null ? idSRMTopic.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof SRMTopic)) {
            return false;
        }
        SRMTopic other = (SRMTopic) object;
        if ((this.idSRMTopic == null && other.idSRMTopic != null) || (this.idSRMTopic != null && !this.idSRMTopic.equals(other.idSRMTopic))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ve.ejb.entity.SRMTopic[id=" + idSRMTopic + "]";
    }

}//ends of class
